Skip to content

Conversation

@mithilP007
Copy link

Summary

This PR adds a new ghost (transparent) variant to the Textarea component, allowing the textarea to blend seamlessly with custom-styled containers without visible borders or background.

Changes

TypeScript (Textarea.tsx)

  • Added "ghost" to the Variants union type for the variant prop
  • Updated prop type: Variants<"outline" | "soft" | "ghost">

CSS (Textarea.module.css)

  • Added new ghost variant styling section
  • Transparent background by default (blends with container)
  • No border in default state
  • Subtle box-shadow on focus for visual feedback
  • Red border on invalid state for error indication

Use Case

As described in issue #6, this variant enables developers to implement textareas in interfaces where the input field needs to blend with custom-styled containers, eliminating the need for !important CSS overrides.

Testing

The implementation follows the existing pattern used in the Button component's ghost variant and is consistent with the design system's architecture.

Fixes #6

Updated TypeScript definition to include 'ghost' variant alongside 'outline' and 'soft' variants.

Addresses issue openai#6 - Part 1 of 2 (CSS styling to be added in next commit)
Implemented transparent ghost variant styling:
- Transparent background with no border by default
- Subtle box-shadow on focus for visual feedback
- Invalid state indication with red border
- Seamlessly blends with custom-styled containers

Addresses issue openai#6 - Part 2 of 2 (completes the feature)
Copy link
Collaborator

@tylersmith-openai tylersmith-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing, @mithilP007!

Before we merge this, let's add coverage in a few more spots:

I'm also curious if a hover treatment should be involved here, like subtly peaking the border. For ghost, that would match the behavior I'd expect.

We could additionally support a bare or none variant that never applies border/background treatments under any conditions (leaving those decisions up to the integrator).

Comment on lines +160 to +161
Ghost variant
============================================= */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
Ghost variant
============================================= */
Ghost variant
============================================= */

Ghost variant
============================================= */
&:where([data-variant="ghost"]) {
/* No background or border by default, blends with container */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid unnecessary comments

Suggested change
/* No background or border by default, blends with container */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add transparent or ghost variant to Textarea component

2 participants